package service.impl;

import dao.ICityDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import pojo.City;
import service.ICityService;

import java.util.List;

@Service
public class CityServiceImpl implements ICityService {

    @Autowired
    private ICityDao cityDao;

    public List<City> getAllCities() {
        return cityDao.getAllCities();
    }

    public City getCityByCid(int cid) {
        return cityDao.getCityByCid(cid);
    }

    public boolean updateCity(City c) {
        return cityDao.updateCity(c) > 0;
    }

    public boolean saveCity(City c) {
        return cityDao.saveCity(c) > 0;
    }

    public boolean deleteCity(int cid) {
        return cityDao.deleteCity(cid) > 0;
    }
}
